<div class="farm-overhaul-container">
  <aside class="farm-overhaul-aside"[hidden]="active!=1">
    <!-- <app-turbine-tag-selector [oneFarm]="true" [currentFarmId]="currentFarmId" (turbinesEmit)="onTurbinesEmit($event)">
    </app-turbine-tag-selector> -->
    <app-device-tag-selector fxFlexFill
        [deviceCategories]="deviceCategory"
        [selectedFarmId]="currentFarmId"
        [choiceDeviceCount]="deviceCountLimit"
        [multipleFarm]="false"
        [includeTagSelector]="false"
        (selectedDevicesChange)="onSelectedDevicesChange($event)">
        </app-device-tag-selector>
  </aside>
  <section class="farm-overhaul-main flex flex-column flex-full">
    <header class="overhaul-main-header flex">

      <div class="farms flex-full">
        <span [ngClass]="{active:active === 0}" (click)="onHeaerClick(0)">
              当前带病运行
          </span>
        <span [ngClass]="{active:active === 1}" (click)="onHeaerClick(1)">
              风场带病运行
          </span>
        <span [ngClass]="{active:active === 2}" (click)="onHeaerClick(2)">
              公司带病运行
          </span>

      </div>
      <div class="time-choose flex">
        <div class="farms-select" [ngClass]="{unactive:active === 0 || active===2 }">
          <span class="farm-name"><i></i> <b>风场:</b> </span>
          <select name="currentFarmId" id="currentFarmId" [(ngModel)]="currentFarmId">
            <option  *ngFor="let item of farms let i =index " [value]="item.farmId">{{item.farmName}}</option>
          </select>
        </div>
        <b class="trend-main-header" [ngClass]="{unactive:active === 0}">
          <label for="">
            <input type="checkbox" name="" id="" value="" [(ngModel)]="notComplete" (change)="onCompleteChange($event.target)">未完成
          </label>
          <label for="">
              <input type="checkbox" name="" id="" value="" [(ngModel)]="complete" (change)="onCompleteChange($event.target)">已完成
          </label>
        </b>
        <b class="trend-main-header">
          <label for="" *ngFor="let item of turboperCategorys;let i=index">
            <input type="checkbox" name="" id="" value="" (change)="onBoxChange($event.target,item)">{{item?.operCategoryName}}
          </label>

        </b>

      </div>
      <div class="time-choose" *ngIf="active">

        开始时间：
        <p-calendar [locale]="en" [(ngModel)]="startDate"></p-calendar>

        结束时间：
        <p-calendar [locale]="en" [(ngModel)]="endDate"></p-calendar>
        <button class="button" (click)="onSearch()">查询</button>

      </div>
      <div class="time-choose">
        <button class="button" (click)="onEdit()">编辑</button>
      </div>
    </header>
    <section class="overhaul-main-content  flex-full">
      <app-overhaul-table [ngClass]="{'overhaul-table':true,on:active==0}" #overhaultable (emitSelectHistory)="onSelectHistory($event)"
        [turboperHistorys]="currentTurboperHistorys"></app-overhaul-table>
      <app-overhaul-table [ngClass]="{'overhaul-table':true,on:active==1}" #overhaultable (emitSelectHistory)="onSelectHistory($event)"
        [turboperHistorys]="farmTurboperHistorys"></app-overhaul-table>
      <app-overhaul-table [ngClass]="{'overhaul-table':true,on:active==2}" #overhaultable (emitSelectHistory)="onSelectHistory($event)"
        [turboperHistorys]="companyTurboperHistorys"></app-overhaul-table>
    </section>


  </section>
</div>
<app-overhaul-edit *ngIf="isEdit" (colseEdit)="onColseEdit($event)" class="farm-overhaul-edit" [currentHistory]="currentHistory"></app-overhaul-edit>
<p-dialog header="提示信息" [(visible)]="display" modal="modal" width="250" [responsive]="true">
  <p>{{mes}}!</p>
  <p-footer>
    <button type="button" pButton icon="fa fa-check" (click)="display=false" label="确定"></button>
  </p-footer>
</p-dialog>
